﻿<UserControl x:Class="Blacklight.Showcase.Wpf.Samples.WatermarkedTextBoxSample"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
      xmlns:controls="clr-namespace:Blacklight.Controls.Wpf;assembly=Blacklight.Controls.Wpf"
    >

    <UserControl.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="/Blacklight.Showcase.Wpf;component/ResourceDictionaries/DavesGlossyControls.xaml"/>
                <ResourceDictionary>
                    <DataTemplate x:Key="TextWatermark">
                    <TextBlock Text="Enter text here..." FontStyle="Italic" Foreground="#ffcecece" />
                </DataTemplate>

                <DataTemplate x:Key="ImageWatermark">
                    <StackPanel Orientation="Horizontal">
                        <Image Source="../Images/placeholder.jpg" Height="17" Opacity="0.5" />
                        <TextBlock Text="Enter text here..." Margin="5,0,0,0" FontStyle="Italic" Foreground="#ffcecece" />
                    </StackPanel>
                </DataTemplate>

                <DataTemplate x:Key="UIElementWatermark">
                    <StackPanel Orientation="Horizontal">
                        <Canvas Width="16" Height="16">
                            <controls:LoadingAnimation AutoPlay="True" Opacity="0.5">
                                <controls:LoadingAnimation.RenderTransform>
                                    <ScaleTransform ScaleX="0.18" ScaleY="0.18" />
                                </controls:LoadingAnimation.RenderTransform>
                            </controls:LoadingAnimation>
                        </Canvas>
                        <TextBlock Text="Enter text here..." Margin="5,0,0,0" FontStyle="Italic" Foreground="#ffcecece" />
                    </StackPanel>
                </DataTemplate>
                </ResourceDictionary>
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
        
        
    </UserControl.Resources>

    <Grid x:Name="LayoutRoot">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="*" />
        </Grid.RowDefinitions>

        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="Auto" />
            <ColumnDefinition Width="Auto" />
            <ColumnDefinition Width="*" />
        </Grid.ColumnDefinitions>

        <TextBlock Foreground="#ffffffff" FontSize="14" FontFamily="Verdana" Margin="5"
                   Text="Example Watermarks" VerticalAlignment="Center" />
        <ComboBox Width="195" Grid.Column="1" HorizontalAlignment="Left" Margin="10,5,5,5" x:Name="watermarkTypeComboBox" Style="{StaticResource GlossyBlackComboBox}"
                  Foreground="White" FontFamily="Verdana" Height="25">                     
        </ComboBox>
        <TextBlock Foreground="#ffffffff" FontSize="12" FontFamily="Verdana" Margin="5" Grid.Column="2" TextWrapping="Wrap"
                   Text="" VerticalAlignment="Center" />

        <Border CornerRadius="10" Background="#ffffffff" Grid.Row="1" Grid.ColumnSpan="3" Margin="0,15,0,0">            
            <controls:WatermarkedTextBox x:Name="watermarkedTextBox" Margin="20" WatermarkTemplate="{StaticResource TextWatermark}" VerticalAlignment="Top" TextWrapping="Wrap"/>                            
        </Border>

    </Grid>
</UserControl>
